Skip to main content
This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal

HCL Notes/Domino 8.5 Forum (includes Notes Traveler)

HCL Notes/Domino 8.5 Forum (includes Notes Traveler)

Previous Next
Subject: Persnickety LotusScript Error
Feedback Type: Problem
Product Area: Notes Client
Technical Area: Application Development
Platform: Windows
Release: 8.5.1
Reproducible: Always

Hi guys, I'm a newbie to script and looking for some help troubleshooting an agent. I copied a client-run agent (that works fine) to perform a slightly different function. This new agent is throwing an error ('Object variable not set').
In debug mode the failure happens quite early on at 'If item.Values(0)<>"" Then' so I'm guessing I've declared something wrong, but can't seem to figure out what. Any help would be greatly appreciated ;)

Dim conn As Variant
Dim sRoot As String
Dim rs
Sub Initialize

Dim session As New NotesSession
Dim db As NotesDatabase
Dim collection As NotesDocumentCollection
Dim doc As NotesDocument

Set db = session.CurrentDatabase
Set collection = db.UnprocessedDocuments
Set doc = collection.GetFirstDocument()

While Not(doc Is Nothing)
UpdateDoc = False
Set item = doc.GetFirstItem( "ShortName" )

If item.Values(0)<>"" Then strADResult = GetADAccount(item.Values(0),"title")
If strADResult <> "" And doc.HasItem("JobTitle") Then

If Replace(strADResult,","," ") <> doc.GetItemValue("JobTitle")(0) Then
Call doc.ReplaceItemValue("JobTitle", Replace(strADResult,","," "))
Print item.Values(0) & " - Updated JobTitle"
UpdateDoc = True
End If
End If
(and it goes on from there....)


Feedback number WEBBAU6T6Z created by ~Phil Refanaskioden on 12/18/2017

Status: Open
Comments:

Persnickety LotusScript Error (~Phil Refanaski... 18.Dec.17)
. . no problem. (~Sigmund Umwema... 18.Dec.17)
. . You want to test if item is empty (~Fritz Ekfoober... 18.Dec.17)
. . . . Error trap (~Sean Eljumigon... 19.Dec.17)
. . . . Empty?? (~Phil Refanaski... 20.Dec.17)
. . . . . . Inspect using debugger (~Lily Minkitexf... 20.Dec.17)
. . . . . . . . It's there alright, but not seen? (~Phil Refanaski... 21.Dec.17)
. . . . . . . . . . I wonder if it being summary protec... (~Fritz Ekfoober... 21.Dec.17)
. . . . . . . . . . . . Access Level = Manager (~Phil Refanaski... 21.Dec.17)
. . . . . . . . . . Look further at the field / item (~Lily Minkitexf... 22.Dec.17)
. . . . . . . . . . . . Check all documents (~Lorraine Nimji... 1.Feb.18)




Printer-friendly

Search this forum

Member Tools


RSS Feeds

 RSS feedsRSS
All forum posts RSS
All main topics RSS